<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查看并审核未审核账户信息 </title>
    <link  href=".././css/accountManage.css" rel="stylesheet" type="text/css"/>
    <link href=".././css/font-awesome.css" rel="stylesheet">
    <link  href=".././css/common.css" rel="stylesheet" />
    <script type="text/javascript" src=".././js/jquery-1.10.1.min.js"></script>
    <script type="text/javascript" src=".././js/google-maps.js"></script>
    <script type="text/javascript" src=".././js/account/personalRegister.js"></script>
    <script>$(document).ready(function(){$(".vertical-nav").verticalnav({speed: 400,align: "left"});});</script>
</head>
<body>
<div id="Container">
    <div id="Header">
        <center><h1>股票交易系统后台管理</h1></center>
    </div>
    <div id="Content">
        <div id="Content-Left">
            <ul class="vertical-nav dark red">
                <li class="active"><a href=".././index.html"><i class="icon-home"></i>首页</a></li>
                <li><a href="  "><i class="icon-cogs"></i>证券账户管理
                    <span class="submenu-icon"></span></a>
                    <ul>
                        <li><a href=".././html/personRegister.html  ">个人账户开户</a></li>
                        <li><a href=".././html/coporationRegister.html">法人账户开户</a></li>
                        <li><a href=".././html/logoutAccount.html">挂失账户</a></li>
                        <li><a href=".././html/lossAccount.html">注销账户信息</a></li>
                        <li><a href=".././html/AccountStateQuery.html">查询账户状态</a></li>
                        <li><a href="../html/accountManage.html">查询账户信息</a></li>
                        <li><a href="../html/accountCheckAndQuery.html">查看并审核未审核客户信息</a></li>
                    </ul>
                </li>
                <li><a href=" "><i class="icon-briefcase"></i>资金账户管理
                    <span class="submenu-icon"></span></a>
                    <ul>
                        <li><a href="./fund/Accountnew.html">创建新资金用户</a></li>
                    </ul>
                </li>
                <li><a href="  "><i class="icon-user"></i>关于我们</a></li>
                <li><a href="  "><i class="icon-envelope"></i>联系我们</a></li>
            </ul>
        </div>
        <div id="Content-Right">
            <div  id="toolbar" class="toolbar">
                <h2 class="title">查看未审核账户信息并审核 </h2>
            </div>
            <!-- 数据修改面板-->
            <div  id="editPanel" style="overflow-x: hidden;margin: 0;padding:0;" >
                <form  id="account_state_select">
                    <table class="edittable" style="width:900px">
                        <tr style="height:0px;border: 0px;">
                            <td class="right" style="width:130px;border: 0px;"></td>
                            <td class="left" style="width:310px;border: 0px;"></td>
                            <td class="right" style="width:130px;border: 0px;"></td>
                            <td class="left" style="border: 0px;"></td>
                        </tr>
                        <tr>
                            <td class="right" style="width:130px;border-top: 0px;">选择账户类型</td>
                            <td class="left" style="border-top: 0px;height: 40px;line-height: 40px;">
                                <select name="type" id="type" class="input"style="width: 100px">
                                    <option value="0">个人 </option>
                                    <option value="1">法人</option>
                                </select>
                            </td>

                            <td class="right" style="width: 100px">账户id</td>
                            <td class="left" style="width:100px" maxlength="18" >
                                <input type="text" id="idNumber" class="input"  name="idNumber"placeholder="账户Id" /></td>
                            </td>
                        </tr>
                        <tr>
                            <td class="right" style="width: 100px"> <input type="button"  value="审核账户" onclick="checkAccount()"/></td>
                            <td class="right" style="width: 100px"><input type="button"  value="查看未审核个人账户" onclick="getNocheckPAccount()"/></td>
                            <td class="right" style="width:100px"><input type="button"  value="查看未审核法人账户" onclick="getNocheckLAccount()"/></td>
                        </tr>
                    </table>
                </form>
            </div>
            <!--数据查询显示区-->
            <div id="querylist">
           <table id="listpt"  >
                    <thead>
                    <tr>
                        <th style="width:10%;">个人账户ID</th>
                        <th style="width:15%;">注册时间</th>
                        <th style="width:15%;" >个人姓名</th>
                        <th style="width:10%;">性别</th>
                        <th style="width:15%;">身份证号</th>
                        <th style="width:15%;">家庭住址</th>
                        <th style="width:15%;">职业</th>
                        <th style="width:15%;">学历</th>
                        <th style="width:15%;">工作单位</th>
                        <th style="width:15%;">电话号码</th>
                        <th style="width:10%;">是否代办</th>
                        <th style="width:15%;">代办身份证号</th>
                        <th style="width:15%;">账户状态</th>
                    </tr>
                    </thead>
                    <tbody id="listP">
                    </tbody>
                </table>
                <table id="listAt" style="display: none" >
                    <thead>
                    <tr>
                        <th style="width:10%;">法人账户号</th>
                        <th style="width:10%;">注册登记号</th>
                        <th style="width:15%;">注册时间</th>
                        <th style="width:15%;">营业执照号码</th>
                        <th style="width:15%;" >法人姓名</th>
                        <th style="width:10%;">法人身份证号</th>
                        <th style="width:15%;">法人联系电话</th>
                        <th style="width:15%;">法人联系地址</th>
                        <th style="width:15%;">授权人姓名</th>
                        <th style="width:15%;">授权人身份证号</th>
                        <th style="width:15%;">授权人联系电话</th>
                        <th style="width:15%;">授权人地址</th>
                        <th style="width:15%;">账户状态</th>
                    </tr>
                    </thead>
                    <tbody id="listA">
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div id="Footer"> <p></font>COPYRIGHT2017-2017 &copy;<BR></font></p></div>
</div>
</body>
</html>
<script type="text/javascript">
    //审核个人或法人的申请
    function checkAccount(){
        var data = $("#account_state_select").serialize();
        $.param(data);
        $.ajax({
            url: "../agent/account/agree",
            type: "POST",
            data: data,
            // processData:false,
            contentType: "application/x-www-form-urlencoded; charset=utf-8",
            dataType: "json",
            success: function (result) {
                //var obj=eval("("+result+")");
                //或者$.parsejson(data);
                if (result.code == 0) {
                    alert(result.message+result.object);
                } else if (result.code == 1) {
                    alert(result.message);
                }
            },
            error: function () {
                alert("审核失败！");
            }
        });
    }


    //查看所有未审核的个人账户
    function getNocheckPAccount(){
        var tbody=window.document.getElementById("listP");
        $.ajax({
            url:"../agent/account/p",
            type:"GET",
            dataType:"json",
            success:function(data){
                console.log(data);
                if(data.code==0){
                    var str="";
                    var tdata=data.object;
                    for( i in tdata){
                        console.log(tdata[i].lAccountId );
                        str +="<tr>"+"<td>"+tdata[i].pAccountId+"</td>"+"<td>"+tdata[i].pAccountRegisterTime+"</td>"+"<td>"+tdata[i].pName+"</td>"
                            + "<td>"+tdata[i].pSex+"</td>"+"<td>"+tdata[i].pIdNumber+"</td>"+ "<td>"+tdata[i].pHomeAddress+"</td>"
                            +"<td>"+tdata[i].pOccupation+"</td>" +"<td>"+tdata[i].pEducation+"</td>"+"<td>"+tdata[i].pWorkUnit+"</td>"
                            +"<td>"+tdata[i].pPhoneNumber+"</td>"+"<td>"+tdata[i].pProxy+"</td>"+ "<td>"+tdata[i].pProxyIdNumber+"</td>"
                            +"<td>"+tdata[i].pValidState+"</td>"+"</tr>";
                        tbody.innerHTML =str;
                    }
                }
            },
            error:function(){
                alert("查询失败！");
            }
        });

    }

     //展示所有未审核法人账户
   function  getNocheckLAccount(){
       var tbody=window.document.getElementById("listA");
       $.ajax({
           url:"../agent/account/l",
           type:"GET",
           dataType:"json",
           success:function(data){
               console.log(data);
               if(data.code==0){
                   var str="";
                   var tdata=data.object;
                   for( i in tdata){
                       console.log(tdata[i].lAccountId );
                       str +="<tr>"+"<td>"+tdata[i].lAccountId +"</td>"+"<td>"+tdata[i].lValidRegisterTime+"</td>"+"<td>"+tdata[i].lValidRegisterNumber+"</td>"
                           + "<td>"+tdata[i].lBusinessLicenserNumber+"</td>"+"<td>"+tdata[i].lName+"</td>"+ "<td>"+tdata[i].lIdNumber+"</td>"
                           +"<td>"+tdata[i].lPhoneNumber+"</td>" +"<td>"+tdata[i].lContactAddress+"</td>"+"<td>"+tdata[i].authorizerName+"</td>"
                           +"<td>"+tdata[i].authorizerIdNumber+"</td>"+"<td>"+tdata[i].authorizerPhoneNumber+"</td>"+ "<td>"+tdata[i].authorizerContactAddress+"</td>"
                           +"<td>"+tdata[i].lValidState+"</td>"+"</tr>";
                       tbody.innerHTML =str;
                   }
               }
           },
           error:function(){
               alert("查询失败！");
           }
       });
    }



</script>
